package com.dev;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.Space;
public class GUISettings extends LinearLayout implements OnClickListener{
    final static String NOTE_TEXT_SIZE="note_text_size";
	final static String showStatus="show_statusbar";
	IconView ivQuit;
	CheckableItem ci1;
	int itemHeight;
	int underColor=0xff777777;
    LinearLayout titlebar;
    LayoutParams titlebarlp;
	LayoutParams pagelp;
	int pageIndex;
	MainActivity ma;
	GUISettings(MainActivity ma){
		super(ma);
		this.ma=ma;
		setOrientation(VERTICAL);
		itemHeight=(int)(25*ma.dp);
		ivQuit=new IconView(ma);
		ivQuit.setOnClickListener(this);
		ivQuit.setImageResource(R.drawable.ic_arrow_left);
		titlebar=new LinearLayout(ma);
		titlebar.setOrientation(HORIZONTAL);
		titlebar.setBackgroundColor(ma.titlebarBackgroundColor);
		titlebar.addView(ivQuit);
		titlebar.addView(new Space(ma),new LayoutParams(0,-1,1f));
		ci1=new CheckableItem(ma,"文本编辑上方显示statusbar");
		ci1.setOnClickListener(this);
		ci1.setSelected(ma.shr.getBoolean(showStatus,true));
		ci1.borderColor=underColor;
		addView(titlebar,-1,ma.titlebarHeight);
		addView(ci1,-1,itemHeight);
	}
	@Override
	public void onClick(View view) {
		if(view==ivQuit){
			ma.setContentView(ma.gui);
		}else if(view==ci1){
			if(ci1.isSelected()){
				ci1.setSelected(false);
			}else{
				ci1.setSelected(true);
			}
		}
	}
}
